package com.geezdata.cps.base.utils;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

public class MapUtil {

    /**
     * 去除map中值为null的键值对
     * @param map<?,?>
     * @return map<?,?>
     */
    public static void removeNull(Map<?,?> map){
        if (map == null || map.size() == 0) return;
        Iterator<?> it = map.entrySet().iterator();
        while (it.hasNext()){
            Map.Entry<?, ?> entry = (Entry<?, ?>) it.next();
            if (entry.getValue() == null){
                it.remove();
            }
        }
    }
}
